package ddemo.service;

import ddemo.dao.CbookingMapper;
import ddemo.dao.ParkinglotMapper;
import ddemo.dao.PbookingMapper;
import ddemo.factory.MapperProxyFactory;
import ddemo.pojo.Cbooking;
import ddemo.pojo.Pbooking;
import ddemo.pojo.User;

import java.util.List;

public class PbookingService {
    private static PbookingMapper pbookingMapper = MapperProxyFactory.getMapper(PbookingMapper.class);

    public static List<Pbooking> getAll(){
        return pbookingMapper.getAll();
    }

    public static int book(Integer id, User user, String time) {
        String usestatus ="已预约";
        Integer userid=user.getId();
        return pbookingMapper.book(userid,usestatus,id,time);
    }}
